package com.weixin.paleituo.adapter;

import android.content.Context;
import android.widget.TextView;

import com.weixin.paleituo.R;
import com.weixin.paleituo.base.BaseRecycleAdapter;
import com.weixin.paleituo.bean.TracesBean;
import com.weixin.paleituo.help.RecycleViewHolder;
import com.weixin.paleituo.util.UIUtils;

import java.util.List;

/**
 * Author yichao
 * Time  2018/4/11 11:00
 * Dest  物流
 */

public class ExpressRecycleAdapter extends BaseRecycleAdapter<TracesBean> {

    private TextView mTextView;
    private TextView mTvExpressContet;
    private TextView mTvExpressTime;

    public ExpressRecycleAdapter(Context context, List<TracesBean> datas) {
        super(context, datas, R.layout.item_express);
    }

    @Override
    protected void setData(RecycleViewHolder holder, TracesBean tracesBean, int position) {
        mTextView = holder.getItemView(R.id.tv_dot);
        mTvExpressContet = holder.getItemView(R.id.tv_express_content_item_express);
        mTvExpressTime = holder.getItemView(R.id.tv_express_time_item_express);

   if (position==0){

       mTextView.setSelected(true);
       mTvExpressContet.setTextColor(UIUtils.getColor(R.color.c_29CE7E));
       mTvExpressTime.setTextColor(UIUtils.getColor(R.color.c_29CE7E));


   }else {
       mTextView.setSelected(false);
       mTvExpressContet.setTextColor(UIUtils.getColor(R.color.c_383838));
       mTvExpressTime.setTextColor(UIUtils.getColor(R.color.c_383838));

   }
        mTvExpressContet.setText(tracesBean.getAcceptStation());
    mTvExpressTime.setText(tracesBean.getAcceptTime());






    }

}
